import { _decorator, Component, Node, Label, Sprite, clamp01 } from 'cc';
import { BasicUI } from '../../Init/Basic/BasicUI';
import { EventTypes } from '../../Init/Managers/EventTypes';
import { AudioEnum } from '../../Init/SystemAudio/AudioEnum';
import { AudioSystem } from '../../Init/SystemAudio/AudioSystem';
import { UIEnum } from '../../Init/SystemUI/UIEnum';
import { UISystem } from '../../Init/SystemUI/UISystem';
const { ccclass, property } = _decorator;

@ccclass('ResurgenceUI')
export class ResurgenceUI extends BasicUI {

    public show(d?) {
        super.show(d);
    }

    public hide(d?) {
        super.hide(d);
    };

    // #region ----------------按钮---------
    // 关闭
    public onCloseClick() {
        AudioSystem.playEffect(AudioEnum.BtnClick);

        this.emit(EventTypes.RoleEvents.CanceResurgence);
        UISystem.hideUI(UIEnum.ResurgenceUI);
    }
    //视频
    public onResurgenceClick() {


        this.emit(EventTypes.SDKEvents.ShowVideo, {
            success: () => {
                //观看视频成功
                this.emit(EventTypes.RoleEvents.Resurgence);
                UISystem.hideUI(UIEnum.ResurgenceUI);
            },
            fail: () => {

            },
            cancel: () => {

            },
        })
    }

    // #endregion




    // #region
}

